<?php
	$admin_info 			= new Zendvn_System_Info();
	$admin_info 			= $admin_info->getMemberInfo();
	//----------------------- INPUT ELEMENTS -------------------//
	$ssFilter 		= $this->arrParam['ssFilter'];
	
	$selectLanguages = $ssFilter['lang_code'] . $this->formHidden('lang_code',$ssFilter['lang_code']);
	$name 				= $this->formText ( 'name', $this->Item['name'], array ('class' => 'txtlong active', 'onchange'=>"get_alias()") ) . '<div class="view_error" id="view_name"></div>';
	$giagiam 			= $this->formText ( 'giagiam', '0', array ('class' => 'txt active', 'onchange'=>"get_alias()") );
	$phantram 			= $this->formText ( 'phantram', '0', array ('class' => 'txt active', 'onchange'=>"get_alias()") );
	$ngaybatdau	 		= $this->formText ('ngaybatdau', $this->Item['ngaybatdau'], array ('class' => 'hasDatePicker active','style'=>'min-width:200px;', 'onchange'=>"get_alias()") ) . '<div class="view_error" id="view_ngaybatdau"></div>';
	
	
// 	array(
// 			key  => value,
// 			key2 => value2,
// 			key3 => value3,
			
// 	);
	
// 	for ($i = 0; $i <= 23; $i++){
// 		$optionsGio[$i] = $i;
// 	}
	//$optionsSo=array("00" => '00',"01"=> '01',"02"=> '02',"03"=> '03',"04"=> '04',"05"=> '05',"06"=> '06',"07"=> '07',"08"=> '08',"09"=> '09');
	$optionsGio=array("00" => '00',"01"=> '01',"02"=> '02',"03"=> '03',"04"=> '04',"05"=> '05',"06"=> '06',"07"=> '07',"08"=> '08',"09"=> '09');
	for ($i = 10; $i <= 23; $i++){
		$optionsGio[$i] = $i;
	}
	$optionsPhut=array("00" => '00',"01"=> '01',"02"=> '02',"03"=> '03',"04"=> '04',"05"=> '05',"06"=> '06',"07"=> '07',"08"=> '08',"09"=> '09');
	for ($i = 10; $i <= 59; $i++){
		$optionsPhut[$i] = $i;
	}
	$optionsGiay=array("00" => '00',"01"=> '01',"02"=> '02',"03"=> '03',"04"=> '04',"05"=> '05',"06"=> '06',"07"=> '07',"08"=> '08',"09"=> '09');
	for ($i = 10; $i <= 59; $i++){
		$optionsGiay[$i] = $i;
	}
	
	$slbGioTu 			= $this->formSelect('gio_tu',$this->Item['gio_tu'],array('style' => 'float: none;'), $optionsGio);
	$slbPhutTu 			= $this->formSelect('phut_tu',$this->Item['phut_tu'],array('style' => 'float: none;'), $optionsPhut);
	$slbGiaytu 			= $this->formSelect('giay_tu',$this->Item['giay_tu'],array('style' => 'float: none;'), $optionsGiay);
	
	$slbGioDen 				= $this->formSelect('gio_den',$this->Item['gio_den'],array('style' => 'float: none;'), $optionsGio);
	$slbPhutDen 			= $this->formSelect('phut_den',$this->Item['phut_den'],array('style' => 'float: none;'), $optionsPhut);
	$slbGiayDen 			= $this->formSelect('giay_den',$this->Item['giay_den'],array('style' => 'float: none;'), $optionsGiay);
	
	$ngayketthuc	 	= $this->formText ('ngayketthuc', $this->Item['ngayketthuc'], array ('class' => 'hasDatePicker active','style'=>'min-width:200px;', 'onchange'=>"get_alias()") ) . '<div class="view_error" id="view_ngayketthuc"></div>';
	
	$content 		= $this->cmsEditor('content',htmlspecialchars_decode($this->Item['content']),array('toolbar'=>'MyToolbar', 'language'=>'vi'));
	 
	$arrInput = array(
				//array('label' => 'Chọn ngôn ngữ','input' => $selectLanguages),
				array('label' => 'Tên chương trình','input' => $name, 'desc' => '<span class="red">*</span>'),
				array('label' => 'KM trực tiếp tính theo (VNĐ)','input' => $giagiam),
				array('label' => 'KM trực tiếp tính theo (%)','input' => $phantram),
				array('label' => 'Ngày bắt đầu','input' => $ngaybatdau . ' - Giờ '.$slbGioTu.' Phút '.$slbPhutTu.' Giây '.$slbGiaytu),
				array('label' => 'Ngày kết thúc','input' => $ngayketthuc.' - Giờ '.$slbGioDen.' Phút '.$slbPhutDen.' Giây '.$slbGiayDen),
				array('label' => 'Mô tả','input' => $content, 'cols' => 2,'style' => 'padding-top:0;'),
			);
	 
	
	//-------------------- SESSAGES ERROR ------------------
	if(count($this->messageError)>0){
		$errors = $this->formErrors($this->messageError,array('id'=>'errors'));
	}
?>

<div class="left_content">
	<?php echo $this->render($this->arrParam['controller'] . '/toolbar/left.php');?>
</div>

<div class="right_content">
	<div class="appContent">
		<?php echo $this->render('admin-khuyenmai/toolbar/index.php');?>
	 	<div class="clr"></div>
	<form name="appForm" method="post" action="" enctype="multipart/form-data">
		<?php //echo $this->render($this->arrParam['controller'] . '/toolbar/index.php');?>
			<?php
				//-------------------- SESSAGES ERROR ------------------
				if(count($this->messageError)>0){
					foreach ($this->messageError AS $key => $val){
						echo '<div class="listError" data="'.$key.'" rel="' . $val . '"></div>';
					}
					echo '<div class="thongbaoError goc5">Có lỗi trong quá trình xử lý.</div>';
				} 
			?>
	
	
	
	 <div id="tabs">
				<ul>
					<li><a href="#tabs-1">Thêm mới khuyến mại</a></li>
				</ul>
				<div id="tabs-1">
	<div class="tblForm">
		<!-- BEGIN: CONTENT -->
		<div class="app_content goc10">
			<div class="width-60 fl">
					<table class="adminformlist">
						<?php echo $this->partialLoop('row.php', $arrInput);?>
					</table>
			</div>
			
			<div class="clr"></div>
		</div>
		<!-- END: 	CONTENT -->
	</div> 
	</div>
	</div>
	</form>
</div>
</div>
<div class="clr"></div>	